//
//  PictureHeaderView.m
//  Lucky28
//
//  Created by zr on 2018/8/1.
//  Copyright © 2018年 zr. All rights reserved.
//

#import "PictureHeaderView.h"

@interface PictureHeaderView ()

@property(nonatomic, weak)UIImageView * backImageView;
@property(nonatomic, weak)UIView * bottomView;

@end

@implementation PictureHeaderView

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
    }
    return self;
}


- (void)setupUI{
    
    self.backgroundColor = [UIColor whiteColor];
    
    UIImageView * backImageView = [UIImageView new];
    
    backImageView.image = ImageNamed(@"tupian-1");
    
    self.backImageView = backImageView;
    
    [self addSubview:self.backImageView];
    
    
    UIView * bottomView = [UIView new];
    
    bottomView.backgroundColor = ColorWithRGB(0xF3F2F2);
    
    self.bottomView = bottomView;
    
    [self addSubview:self.bottomView];
}


- (void)layoutSubviews{
    
    [self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.top.bottom.mas_equalTo(self);
    }];
    
    [self.bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.leading.trailing.mas_equalTo(self);
        make.height.mas_equalTo(5 * SCREENH6);
    }];
}

@end
